package di.annotation;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component(value="serverEt")
@Scope(value="prototype")
public class Server {
	@Value(value="${si.serverName}")
	private String serverName;
	@Value(value="${si.ip}")
	private String ip;
	@Value(value="${si.port}")
	private int port;
	@PostConstruct
	public void serverInit(){
		System.out.println("init");
	}
	@PreDestroy
	public void destoryFun(){
		System.out.println("");
	}
	public String getServerName() {
		return serverName;
	}
	public void setServerName(String serverName) {
		this.serverName = serverName;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	@Override
	public String toString() {
		return "Server [serverName=" + serverName + ", ip=" + ip + ", port="
				+ port + "]";
	}
	
	
	
	
}
